package com.tiancheng.trade.order.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 预授权订单操作表-操作类型说明
 */
@Getter
@AllArgsConstructor
public enum CreditOrderOperationTypeEnum {
    FREEZE("FREEZE", "冻结"),
    UNFREEZE("UNFREEZE", "解冻"),
    PAY("PAY", "支付"),
    ;
    private String code;
    private String desc;

    public static String getDesc(String code) {
        CreditOrderOperationTypeEnum[] businessModeEnums = values();
        for (CreditOrderOperationTypeEnum statusEnum : businessModeEnums) {
            if (statusEnum.code().equals(code)) {
                return statusEnum.desc();
            }
        }
        return null;
    }

    public String code() {
        return this.code;
    }

    public String desc() {
        return this.desc;
    }
}
